{extend name="template/base" /}
{block name="content"}
<div class="page-container">
<div class="toptip">
    <h2>提示：</h2>
    <p>
      新建考试，设定当次考核名称，选择所需题目类型<br>
    </p>
  </div>
    <form class="form form-horizontal" id="form" method="post" action="{:\\think\\Request::instance()->baseUrl()}">
	<legend><i class="Hui-iconfont">&#xe600;</i>新增科目</legend>
        <input type="hidden" name="id" value="{$vo.id}">
        <div class="row cl">
            <label class="form-label f-l ml-20">科目名称：</label>
            <div class="formControls col-xs-8 col-sm-5">
                <input type="text" class="input-text radius size-M" placeholder="请输入科目名称，2字符以上" name="s_name" value="{$vo.s_name ?? ''}" datatype="*" nullmsg="您必须填写科目" >				
            </div>
            <div class="col-xs-offset-4"></div>
        </div>
        <div class="row cl">
            <label for="subject" class="form-label f-l ml-20">科目题型：</label>
            <div class="col-xs-8 col-sm-6 skin-minimal">
                {volist name="questypes" id="questype"}
                <div class="check-box formControls">
                    <input type="checkbox" id ="T{$questype['id']}" name="s_setting[questypes][{$questype['id']}]" value="1" {if isset($vo['s_setting']['questypes'][$questype['id']]) && $vo['s_setting']['questypes'][$questype['id']]==1}checked{/if}/> 
					<label for="T{$questype['id']}">{$questype['type']}</label>
				</div>
                {/volist}
            </div>
        </div>
       <div class="row cl">			
            <div class="ml-save">
                <button type="submit" class="btn btn-primary radius">&nbsp;&nbsp;保 存&nbsp;&nbsp;</button>
                <button type="button" class="btn btn-default radius ml-20" onClick="layer_close();">&nbsp;&nbsp;取 消&nbsp;&nbsp;</button>
           </div>
        </div>
    </form>
</div>
{/block}
{block name="script"}
<script type="text/javascript" src="__LIB__/Validform/5.3.2/Validform.min.js"></script>
<script>
    $(function () {


        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });

        $("#form").Validform({
            tiptype: 2,
            ajaxPost: true,
            showAllError: true,
            callback: function (ret){
                ajax_progress(ret);
            }
        });
    })
</script>
{/block}
